package com.spzx.channel.controller;

import com.spzx.channel.service.ProductService;
import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.domain.SkuQuery;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "商品管理")
@RestController
@RequestMapping("/list")
public class ProductController extends BaseController {

    @Autowired
    private ProductService productService;

    @Operation(summary = "商品搜索")
    @GetMapping("/skuList/{pageNum}/{pageSize}")
    public TableDataInfo skuList(@PathVariable(value = "pageNum") Integer pageNum, @PathVariable(value = "pageSize")Integer pageSize, SkuQuery skuQuery){
        //调用ProductService中获取商品列表的方法
        TableDataInfo tableDataInfo = productService.getProductSkuList(pageNum,pageSize,skuQuery);
        return tableDataInfo;
    }

}
